﻿@page "/counter"

@using StudentVideo.Client.Common.Attributes
@using StudentVideo.Client.Services
@inject PageLoadingService _pageLoading;
@attribute [MenuMate("计算演示", 2)]

<PageTitle>Counter</PageTitle>

<h1>Counter</h1>

<p role="status">Current count: @currentCount</p>

<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>

@code
{
   private int currentCount = 0;

   private void IncrementCount()
   {
      currentCount++;
   }

   protected override void OnInitialized()
   {
      _pageLoading.SetStatus(false);
   }

   @* protected override void OnAfterRender(bool firstReader)
   {
      base.OnAfterRender(firstReader);

      Thread.Sleep(5000);

      _pageLoading.SetStatus(false);
   } *@

}
